package org.ihelpuoo.weboo.checkers;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import org.ihelpuoo.lang.StringUtils;

public class SimpleDateChecker extends AbstractChecker
{

	public boolean isValid(String value)
	{
		value = StringUtils.alignRight(value,10,'0').toString();
		try
		{
			if (value.length() != 10)
				return false;
			DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
			df.parse(value);
		}
		catch (Exception e)
		{
			return false;
		}
		return true;
	}

	public void setSetting(String setting)
	{
	}

}
